using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

/**clase creada por el JC*/
namespace HS {
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class BackgroundComponent : Microsoft.Xna.Framework.DrawableGameComponent {
        Texture2D fondo;
        SpriteBatch spriteBatch = null;
        Rectangle bgRect;

        public BackgroundComponent(Game game, Texture2D textura)
            : base(game) {
            this.fondo = textura;
            spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));

            bgRect = new Rectangle(0, 0, Game.Window.ClientBounds.Width, Game.Window.ClientBounds.Height);
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize() {
            base.Initialize();
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime) {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime) {
            spriteBatch.Draw(fondo, bgRect, Color.White);
            base.Draw(gameTime);
        }
    }
}
